package com.cy.account.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cy.account.entity.Account;

import java.math.BigDecimal;

public interface AccountMapper extends BaseMapper<Account> {
    //根据userId扣减金额
    void decrease(Long userId, BigDecimal money);

    // selectById() 查询账户用来判断是否有足够的可用金额

    //第一阶段
    void updateResidueToFrozen(Long userId,BigDecimal money);
    //第二阶段，提交
    void updateFrozenToUsed(Long userId,BigDecimal money);
    //第二阶段，回滚
    void updateFrozenToResidue(Long userId,BigDecimal money);

}
